/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ThayDoiQuiDinhChungInternalFrame.java
 *
 * Created on Jul 12, 2010, 10:30:41 AM
 */

package GUI;

import javax.swing.JOptionPane;

/**
 *
 * @author May2
 */
public class ThayDoiQuiDinhChungInternalFrame extends javax.swing.JInternalFrame {

    public void hienThiQuiDinhChung(){
        //QuiDinhPOJO qd = QuiDinhBUS.selectQuiDinhChung();

        //Gán dữ liệu cho textfield
        //this.jtfSoLoaiDaiLy.setText(String.valueOf(qd.getSoLoaiDaiLy()));
        //this.jtfSoMatHang.setText(String.valueOf(qd.getSoMatHang()));
    }
    /** Creates new form ThayDoiQuiDinhChungInternalFrame */
    public ThayDoiQuiDinhChungInternalFrame() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jbtThayDoiSoDaiLyToiDa = new javax.swing.JButton();
        jbtThoat = new javax.swing.JButton();

        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setTitle("THAY DOI CAC QUI DINH CHUNG");
        addInternalFrameListener(new javax.swing.event.InternalFrameListener() {
            public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameOpened(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Qui Định"));

        jLabel1.setText("Số Cửa Hàng Tối Đa :");

        jbtThayDoiSoDaiLyToiDa.setText("Thay Đổi");
        jbtThayDoiSoDaiLyToiDa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtThayDoiSoDaiLyToiDaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addComponent(jbtThayDoiSoDaiLyToiDa)
                .addContainerGap(127, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jbtThayDoiSoDaiLyToiDa))
                .addContainerGap(84, Short.MAX_VALUE))
        );

        jbtThoat.setText("Thoát");
        jbtThoat.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtThoatActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(144, 144, 144)
                        .addComponent(jbtThoat, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jbtThoat)
                .addContainerGap(28, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formInternalFrameOpened(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameOpened
        // TODO add your handling code here:
        this.hienThiQuiDinhChung();
    }//GEN-LAST:event_formInternalFrameOpened

    private void jbtThoatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtThoatActionPerformed
        // TODO add your handling code here:
        int reply = JOptionPane.showConfirmDialog(this, "Bạn có muốn thoát", "Thông báo", WIDTH);
        if(reply == JOptionPane.OK_OPTION){
            this.dispose();
        }
    }//GEN-LAST:event_jbtThoatActionPerformed

    private void jbtThayDoiSoDaiLyToiDaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtThayDoiSoDaiLyToiDaActionPerformed
        // TODO add your handling code here:
//        CapNhatSoDaiLyToiDaCuaQuanInternalFrame frm = new CapNhatSoDaiLyToiDaCuaQuanInternalFrame();
//        frm.setVisible(true);
//        this.getDesktopPane().add(frm);
    }//GEN-LAST:event_jbtThayDoiSoDaiLyToiDaActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JButton jbtThayDoiSoDaiLyToiDa;
    private javax.swing.JButton jbtThoat;
    // End of variables declaration//GEN-END:variables

}
